import type { ClassificationType } from '@/models/Classification/Classification'
import { http } from '@/utils/http'

const baseUrl = import.meta.env.VITE_API_PROXY ? `/api/commonDirectory` : `/commonDirectory`

export async function queryAllClassification() {
  return await http.get(`${baseUrl}/queryAllClassification`)
}
export async function getAllClassification() {
  return await http.get(`${baseUrl}/queryAllClassificationAndSecondaryClassification`)
}
export async function querySecondaryClassificationByParent(data: {
  code: string
  type: ClassificationType
}) {
  return await http.get(`${baseUrl}/querySecondaryClassificationByParent`, { params: data })
}
